package com.heima.admin.controller;

import com.heima.admin.service.AdAuthService;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dtos.AuthDto;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/auth")
public class AdAuthController {
    private final AdAuthService adAuthService;

    public AdAuthController(AdAuthService adAuthService) {
        this.adAuthService = adAuthService;
    }

    /**
     * 用户审核查询列表
     * @param authDto
     * @return
     */
    @PostMapping("/list")
    @ApiOperation("查询列表")
    public ResponseResult listAuth(@RequestBody AuthDto authDto){
        return adAuthService.listAuth(authDto);
    }


    /**
     * 审核失败
     * @param authDto
     * @return
     */
    @PostMapping("/authFail")
    @ApiOperation("审核失败")
    public ResponseResult authFail(@RequestBody AuthDto authDto){
        return adAuthService.authFail(authDto);
    }

    /**
     * 审核成功
     * @param authDto
     * @return
     */
    @PostMapping("/authPass")
    @ApiOperation("审核成功")
    public ResponseResult authPass(@RequestBody AuthDto authDto){
        return adAuthService.authPass(authDto);
    }


}
